package deepbrain.markov;

import java.io.FileNotFoundException;
import java.io.PrintWriter;

import deepbrain.simnetwork.exception.SimNetworkException;
import deepbrain.simnetwork.loader.NetworkLoader;
import deepbrain.simnetwork.loader.xml.XmlNetworkLoader;
import deepbrain.simnetwork.mechanism.PLoSHopfieldMechanism;
import deepbrain.simnetwork.network.Network;

public class MarkovDemo {

	public static void main(String[] args) throws SimNetworkException, FileNotFoundException {
		NetworkLoader loader = new XmlNetworkLoader("networks/PLoS-fig18.xml");
		Network network = loader.loadNetwork();
		network.setMechanism(new PLoSHopfieldMechanism(0.35));
		PrintWriter writer = new PrintWriter("outputs/matrix.txt");
		MarkovMatrix matrix = MarkovUtility.getMarkovMatrixFromNetwork(network);
		writer.println(matrix.SerializeToMatlabString());
		writer.close();
//		IITUtility.compPHIforAllStates("networks/PLoS-fig18.xml", new HopfieldMechanism(0.35));
	}
	
}
